home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / f90 / pxfisblk.z / pxfisblk
Text File  |  1998-10-30  |  3KB  |  82 lines

  1. PXFISBLK(3F)                                           Last changed: 1-6-98
  2.  
  3.  
  4. NNAAMMEE
  5.      PPXXFFIISSBBLLKK - Tests for block special file
  6.  
  7. SSYYNNOOPPSSIISS
  8.      LLOOGGIICCAALL FFUUNNCCTTIIOONN PPXXFFIISSBBLLKK((_m))
  9.      IINNTTEEGGEERR _m
  10.  
  11. IIMMPPLLEEMMEENNTTAATTIIOONN
  12.      UNICOS, UNICOS/mk, and IRIX systems
  13.  
  14. SSTTAANNDDAARRDDSS
  15.      IEEE standard interface for FORTRAN 77
  16.  
  17. DDEESSCCRRIIPPTTIIOONN
  18.      On IRIX systems, this routine is in lliibbffoorrttrraann..ssoo which is linked by
  19.      default when compiling programs with the MIPSpro 7 Fortran 90 compiler
  20.      or when compiling programs with the --ccrraayylliibbss option to the MIPSpro
  21.      7.2 F77 compiler.
  22.  
  23.      The logical function PPXXFFIISSBBLLKK checks if a file is a block special
  24.      file. The argument _m should be supplied by the sstt__mmooddee component of
  25.      the ssttaatt structure used by the PPXXFFSSTTAATT(3F) routine.
  26.  
  27.      When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
  28.      UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
  29.      kind unless documented otherwise.  On UNICOS and UNICOS/mk, default
  30.      kind is KKIINNDD==88 for integer, real, complex, and logical arguments; on
  31.      IRIX, the default kind is KKIINNDD==44.
  32.  
  33.      The following argument is valid for this routine:
  34.  
  35.      _m    An integer input variable containing the file mode.
  36.  
  37.      If the file is a block special file, PPXXFFIISSBBLLKK returns a logical true,
  38.      otherwise a logical false is returned.
  39.  
  40. EEXXAAMMPPLLEESS
  41.      In this example, the //ddeevv//ddsskk directory is read until a block special
  42.      file is found or the end of the directory is reached. If a block
  43.      special file is found, the file is printed.
  44.  
  45.           program pxftest
  46.           integer ierror,mode,ilen,EEND
  47.           integer idirid,jdirent,jstat
  48.           logical PXFISBLK, found
  49.           character*30 name, path
  50.  
  51.           CALL PXFSTRUCTCREATE('dirent',jdirent,ierror)
  52.           CALL PXFSTRUCTCREATE('stat',jstat,ierror)
  53.           CALL PXFCONST('EEND',EEND,ierror)
  54.           path = '/dev/dsk'
  55.           found = .FALSE.
  56.           CALL PXFOPENDIR(path,0,idirid,ierror)
  57.           CALL PXFCHDIR(path,0,ierror)
  58.           do while (found .eqv. .FALSE.)
  59.              CALL PXFREADDIR(idirid,jdirent,ierror)
  60.              if (ierror .eq. EEND) then
  61.                 exit
  62.              endif
  63.              CALL PXFSTRGET(jdirent,'d_name',name,ilen,ierror)
  64.              CALL PXFSTAT(name,0,jstat,ierror)
  65.              CALL PXFINTGET(jstat,'st_mode',mode,ierror)
  66.              if (PXFISBLK(mode)) then
  67.                 found = .TRUE.
  68.              endif
  69.           enddo
  70.  
  71.           if (found .eqv. .TRUE.) then
  72.           print *,name,' is a block file.'
  73.           endif
  74.           end
  75.  
  76. SSEEEE AALLSSOO
  77.      PPXXFFCCOONNSSTT(3F), PPXXFFIINNTTSSEETT(3F), PPXXFFSSTTRRUUCCTTCCRREEAATTEE(3F)
  78.  
  79.      _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _L_i_b_r_a_r_y _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-
  80.      2165, for the printed version of this man page.
  81.  
  82.